load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "randgen",
    srcs = [
        "datum.go",
        "doc.go",
        "encdatum.go",
        "expr.go",
        "mutator.go",
        "schema.go",
        "type.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/randgen",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/geo",
        "//pkg/geo/geogen",
        "//pkg/geo/geoindex",
        "//pkg/geo/geopb",
        "//pkg/keys",
        "//pkg/roachpb",
        "//pkg/settings/cluster",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/catenumpb",
        "//pkg/sql/catalog/colinfo",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/parser",
        "//pkg/sql/pgrepl/lsn",
        "//pkg/sql/rowenc",
        "//pkg/sql/rowenc/valueside",
        "//pkg/sql/sem/cast",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sem/tree/treebin",
        "//pkg/sql/sem/tree/treecmp",
        "//pkg/sql/sem/volatility",
        "//pkg/sql/stats",
        "//pkg/sql/types",
        "//pkg/util",
        "//pkg/util/bitarray",
        "//pkg/util/duration",
        "//pkg/util/ipaddr",
        "//pkg/util/json",
        "//pkg/util/randident",
        "//pkg/util/randident/randidentcfg",
        "//pkg/util/randutil",
        "//pkg/util/timeofday",
        "//pkg/util/timeutil",
        "//pkg/util/timeutil/pgdate",
        "//pkg/util/tsearch",
        "//pkg/util/uint128",
        "//pkg/util/uuid",
        "//pkg/util/vector",
        "@com_github_cockroachdb_apd_v3//:apd",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_lib_pq//oid",
        "@com_github_twpayne_go_geom//:go-geom",
    ],
)

go_test(
    name = "randgen_test",
    srcs = [
        "main_test.go",
        "mutator_test.go",
        "schema_test.go",
        "types_test.go",
    ],
    embed = [":randgen"],
    deps = [
        "//pkg/base",
        "//pkg/ccl",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/server",
        "//pkg/sql/sem/tree",
        "//pkg/sql/types",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_stretchr_testify//require",
    ],
)
